Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

ExcludeUnusedElements plugin + loader added #39

Merged
merged 1 commit into from
Jan 10, 2017
Merged

Conversation

enchev
Copy link
Contributor

@enchev enchev commented Dec 22, 2016

No description provided.

@@ -19,5 +19,6 @@
"dependencies": {
},
"devDependencies": {
"htmlparser2": "^3.9.2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

htmlparser2 must be installed by the postinstall script. Without that we get runtime errors on user machines since the module is required by our plugin.

//
}

exports.ExcludeUnusedElements.prototype = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we rename this to ExcludeUnusedElementsPlugin. Other plugins use the same suffix.

}

exports.ExcludeUnusedElements.prototype = {
apply: function (compiler) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just exports.ExcludeUnusedElementsPlugin.prototype.apply = function... ?


if (result.context.indexOf("tns-core-modules") === -1) {
if (result.contextInfo.issuer &&
result.contextInfo.issuer.indexOf("element-registry") !== -1 && global["ELEMENT_REGISTRY"][result.request] &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

global["ELEMENT_REGISTRY"][result.request] && !global["ELEMENT_REGISTRY"][result.request]

I think we need just !global["ELEMENT_REGISTRY"][result.request]

}
}

if (result.contextInfo.issuer.indexOf("bundle-entry-points") !== -1 && global["ELEMENT_REGISTRY"][result.request] &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I think we need just !global["ELEMENT_REGISTRY"][result.request]

@enchev enchev force-pushed the ExcludeUnusedElements branch 2 times, most recently from bfaef4c to aa84f58 Compare December 22, 2016 14:26
@enchev enchev force-pushed the ExcludeUnusedElements branch from aa84f58 to 7b5e9ac Compare January 9, 2017 09:41
@hdeshev hdeshev merged commit 21d6807 into master Jan 10, 2017
@hdeshev hdeshev deleted the ExcludeUnusedElements branch January 10, 2017 09:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants